package com.ljx.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LJX
 * @Description: TODO
 * @Date: 2022/12/30 9:35
 * @Version 1.0
 */
@RestController
@RequestMapping("user")
public class UserController {

	@PreAuthorize(value = "hasAuthority('user:delete')")
	@RequestMapping("delete")
	public String delete(){
		return "用户删除的操作";
	}
	@PreAuthorize(value = "hasAuthority('user:update')")
	@RequestMapping("update")
	public String update(){
		return "用户更新的操作";
	}
	@PreAuthorize(value = "hasAuthority('user:insert')")
	@RequestMapping("insert")
	public String insert(){
		return "用户添加的操作";
	}
	@PreAuthorize(value = "hasAuthority('user:export')")
	@RequestMapping("export")
	public String export(){
		return "用户导出的操作";
	}
	@PreAuthorize(value = "hasAuthority('user:query')")
	@RequestMapping("query")
	public String query(){
		return "用户查询的操作";
	}


}
